var prefix = ctx + "admin/joblog";

$(function() {
    var options = {
        url: prefix + "/page",
        cleanUrl : prefix + "/clean",
        removeUrl: prefix + "/{id}",
        sortName: "createTime",
        sortOrder: "desc",
        modalName: "调度任务日志",
        columns: [{
            checkbox: true
        },
        {
            field: 'jobLogId',
            title: '日志Id',
            visible: false
        }, {
    	    field: 'jobName',
    	    title: '任务名称'
    	},{
    	    field: 'jobGroup',
    	    title: '任务组名'
    	},{
			field : 'jobLogStatus',
			title : '任务执行状态',
			formatter : function(value, row, index) {
				if (value == 0) {
					return '<span class="badge badge-primary">成功</span>';
				} else if (value == 1) {
					return '<span class="badge badge-danger">失败</span>';
				}
			}
		},{
			field : 'jobType',
			title : '类型',
			formatter : function(value, row, index) {
				return $.table.selectDictLabel(typeDatas, value);
			}
		},{
    	    field: 'jobMessage',
    	    title: '日志信息'
    	},{
    	    field: 'executeTime',
    	    title: '运行时间'
    	},{
    	    field: 'exceptionInfo',
    	    title: '异常信息',
    	    formatter: function(value, row, index) {
            	return $.table.tooltip(value, 10, "open");
            }
    	},{
			field : 'createTime',
			title : '开始时间',
			sortable : true
		}]
    };
    $.table.init(options);
});
